package com.dingreading.cloud.common.util;

/**
 * http状态码
 */

public enum ErrorCode {
    SUCCESS(0, "success"),
    SYSTEM_ERROR(500, "system error"),
    BALANCE_NO_ENOUGH(300, "balance  not enough"),

    NAME_ALREADY_EXIST(3001, "name already exist"),
    USERNAME_EMPTY(4001, "username is empty"),
    PASSWORD_EMPTY(4002, "password is empty"),
    NAME_OR_PASSWORD_ERROR(4003, "name or password error"),
    PHONE_ALREADY_EXIST(4004, "phone already exist"),
    USER_IS_NULL(4005, "user is null"),
    ACTIVITY_IS_NULL(4006, "Activity is null"),
    ACTIVITYITEM_IS_NULL(4007, "ActivityItem is null"),
    ACTIVITYLIST_IS_NULL(4008, "ActivityList is null"),
    USER_IS_EXIST(4009, "user is exist"),

    USERNAME_OR_PASSWORD_ERROR(4011, "用户名或密码错误"),
    CODE_ERROR(4012, "验证码错误"),
    ACCOUNT_NUMBER_PROHIBIT(4013, "账号已被禁用"),
    DATA_PROHIBIT(4014, "该数据处于禁用状态"),
    DATA_ALREADY_EXIST(4015, "该数据已存在"),
    DATA_NULL(4016, "暂无数据"),
    ACTIVITY_NOT_START(4017, "活动未开始"),
    ACTIVITY_END(4018, "活动已结束"),
    PHONE_IS_NULL(4019, "手机号为空"),
    NOT_USED(4020, "未使用，可以使用"),
    OPERATION_FAILED(4021, "操作失败"),
    SESSION_TIME_OUT(4022, "登录已到期，请重新登录"),
    TOKEN_INVALID(401, "token invalid"),
    LOGIN_INVALID(-1, "token invalid"),
    APP_NO_POWER(4023, "没有模块权限"),
    DELETE_ERROR(500, "删除失败");

    private final int code;
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
}